const Mock = require('mockjs')

const data = Mock.mock({
    'items|30': [{
        index: '@increment',   //序号
        sender:  () => {                                                       
            const randomLength = Mock.Random.integer(2, 3);
            let chineseCharacters = '';
            for (let i = 0; i < randomLength; i++) {
                chineseCharacters += String.fromCharCode(Mock.Random.integer(0x4e00, 0x9fa5));
            }
            return chineseCharacters;
        },    //发送人
        username: () => {                                                       
            const randomLength = Mock.Random.integer(2, 3);
            let chineseCharacters = '';
            for (let i = 0; i < randomLength; i++) {
                chineseCharacters += String.fromCharCode(Mock.Random.integer(0x4e00, 0x9fa5));
            }
            return chineseCharacters;
        },     //用户名
        phone: '@string("number", 11)',    //手机号
        position:  () => {                                                       
            const randomLength = Mock.Random.integer(10, 16);
            let chineseCharacters = '';
            for (let i = 0; i < randomLength; i++) {
                chineseCharacters += String.fromCharCode(Mock.Random.integer(0x4e00, 0x9fa5));
            }
            return chineseCharacters;
        },    //位置
        send_content: '@integer(100000000000, 999999999999)',    //发送内容
        activate_alarm:'@boolean',     //开启报警
    }]
})
module.exports = [
    {
        url: '/vue-admin-template/alarmWay/wechat',
        type: 'get',
        response: config => {
            const items = data.items
            return {
                code: 20000,
                data: {
                    total: items.length,
                    items: items
                }
            }
        }
    }
]
